<?php
namespace Sys\Controller;
use Todo\Controller\BackendController;
use Todo\Util\ArrayUtil;

/**
 * Class RoleController 角色
 * @package Sys\Controller
 */
class RoleController extends BackendController {


    protected function _initialize(){
        parent::_initialize();
    }

    protected function _filter(&$where){
        if($where['code']) $where['code'] = array('like', '%'. $where['code'].'%');
        if($where['title']) $where['title'] = array('like', '%'. $where['title'].'%');
    }

    public function menu(){
        $roleId = I('get.role_id');
        if(!$roleId) $this->error('非法请求!');
        $menuList = D('Todo/Sys/RoleMenu')->where(array('role_id'=>$roleId))->getField('menu_id', true);
        $this->assign('menuList', $menuList);
        $this->assign('role_id', $roleId);
        $this->display();
    }

}